package net.comm.group.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.group.bean.BaseGAlbum;
import net.comm.group.bean.BaseGFollForum;
import net.comm.group.bean.BaseGForum;
import net.comm.group.bean.BaseGPicture;
import net.comm.group.bean.BaseGroups;
import net.comm.oper.bean.Baseoperlog;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbGPictureService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  gpicID = result.getInt(1);		//
			int  galbumID = result.getInt(2);		//
			int  picName = result.getInt(3);		//文件名
			String  isHead = StringUtil.getValue(result.getString(4));		//是否作为封面
			int  upCnt = result.getInt(5);		//
			int  downCnt = result.getInt(6);		//
			int  userID = result.getInt(7);		//
			String  mtime = StringUtil.getValue(result.getString(8));		//			
			
			
			// create the Resource from these fields
			return new BaseGPicture( gpicID,  galbumID,  picName,  isHead, upCnt, downCnt, userID,  mtime );
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
